package com.layer.common;

import java.io.Serializable;
import java.net.SocketAddress;

public class Message implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static enum Type {
		BROADCAST, DISCONNECT_CLIENT, CONNECT_CLIENT, NORMAL, REQUEST_CLIENTS, SEND_CLIENTS
	}

	private Type type;
	private SocketAddress target,source;
	private Object content;
	
	public Message(Type type, SocketAddress source, SocketAddress target, Object content) {
		this.type = type;
		this.target = target;
		this.content = content;
		this.source = source;
	}

	public Type getType() {
		return this.type;
	}

	public SocketAddress getTarget() {
		return target;
	}

	public Object getContent() {
		return content;
	}

	public SocketAddress getSource() {
		return source;
	}
}
